// 自定义裁剪器

import 'package:flutter/material.dart';

class BoxClipper extends CustomClipper<Path> {
  @override
  Path getClip(Size size) {
    Path path = Path();
    double x = size.width;
    double y = size.height;
    double a = 45;
    path.moveTo(0, a);
    path.lineTo(1*x/3-15, a);
    path.quadraticBezierTo(1*x/3+15, a , 1*x/3+15, a-5);
    path.lineTo(2*x/3-5, 15);
    path.quadraticBezierTo(2*x/3, 0, 2*x/3+15, 0);
    path.lineTo(2*x/3+15, 0);
    path.lineTo(2*x/3+15, 0);
    path.lineTo(x, 0);
    path.lineTo(x, y);
    path.lineTo(0, y);
    return path;
  }
  @override
  bool shouldReclip(CustomClipper<Path> oldClipper) => false;
}
class BoxClipperHome extends CustomClipper<Path> {

  @override
  Path getClip(Size size) {
    Path path = Path();
    double x = size.width;
    double y = size.height;
    double a = 45;
    path.moveTo(0, (a+100));
    path.quadraticBezierTo(0, a ,30, a);
    path.lineTo(1*x/2+40, a);
    // path.quadraticBezierTo(1*x/2+10, a+15 , 1*x/2, a);
    // path.lineTo(2*x/3-15, 15);
    // path.quadraticBezierTo(2*x/3, 0, 2*x/3+15, 0);
    path.lineTo(2*x/3+15, 0);
    path.lineTo(x, 0);
    path.lineTo(x, y);
    path.lineTo(0, y);
    path.close();
    return path;
  }
  @override
  bool shouldReclip(CustomClipper<Path> oldClipper) => false;
}